package com.mallcai.bigdata.ladon.client.vo;

import lombok.Data;
import lombok.RequiredArgsConstructor;

import java.io.Serializable;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author feixy
 * @version 1.0
 * @date 2019-07-31 19:30
 */
@Data
@RequiredArgsConstructor
public class ReportDataVO implements Serializable {

    private final List<ReportColumnVO> columns;

    /**
     * 数据行
     */
    private final List<Map<String, Object>> rows;
    /**
     * 数据数量
     */
    private final Integer                       rowSize;
    /**
     * 分页时对应的总数据量
     */
    private       Long                      totalCount;

    private Map<String, Object> extraInfo = new HashMap<>();

    public ReportDataVO(List<ReportColumnVO> columns, List<Map<String, Object>> rows) {
        this(columns, rows, (rows == null ? 0 : rows.size()));
    }

    private ReportDataVO() {
        this(Collections.emptyList(), Collections.emptyList());
    }

    public static ReportDataVO EMPTY = new ReportDataVO();

}
